package com.woniuxy.happylife.cart.service.Impl;

import com.woniuxy.happylife.cart.dao.CartDao;
import com.woniuxy.happylife.cart.service.CartService;
import com.woniuxy.happylife.entity.MallCart;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Title: CartServiceImpl
 * @ProjectName: happy-life
 * @Description: TODO
 * @Author: chowinggum
 * @Date: 2022/2/17 17:22
 */
@Service
public class CartServiceImpl implements CartService {
    @Resource
    CartDao cartDao;
    @Override
    public List<MallCart> findAllCartByUid(int uid) {
        return cartDao.findAllCartByUid( uid);
    }

    @Override
    public List<MallCart> findByFlag(int uid) {
        return cartDao.findByFlag(uid);
    }

    @Override
    public int addCart(MallCart cart) {
        return cartDao.addcart(cart);
    }

    @Override
    public int deleteCart(int cartid) {
        return cartDao.deletecart(cartid);
    }
}
